package com.yanqu.road.server.cmd.activity.douluoshrek;

import com.yanqu.road.pb.activity.DouLuoShrekProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.shrek.DouLuoShrekModule;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;


@Cmd(code = Protocol.S_DOULUOSHREK_BEAT_BOSS, desc = "")
public class ShrekBeatBossCmd extends AbstractCommand {


    private int type;
    private int solderId;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        DouLuoShrekProto.SolderTestReqMsg reqMsg = DouLuoShrekProto.SolderTestReqMsg.parseFrom(packet.getBytes());
        type = reqMsg.getType();
        solderId = reqMsg.getSolderId();
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        DouLuoShrekProto.SolderTestRespMsg.Builder respMsg = player.getModule(DouLuoShrekModule.class).bossTest(type,solderId);
        player.sendPacket(Protocol.U_DOULUOSHREK_BEAT_BOSS, respMsg);
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
